Methamphetamine use among men who have sex with men (MSM) is deeply integrated into socio-sexual networks including physical risk venues such as circuit parties, sex clubs, and bathhouses and digital spaces such as cell phone applications, websites, and digital chat rooms to hook up for sex. Thus, methamphetamine use is highly associated with HIV infection due specifically to concomitant high-risk sexual behaviors that occur while using the drug. Text-messaging is a novel, feasible, and sustainable approach for targeting high-risk, out-of-treatment MSM; particularly, MSM who fail to attend face-to-face or site-based interventions. A real-time text-messaging intervention capitalizes on a communication channel to which this population will attend at the exact time they are most likely to make high-risk sexual decisions. This application is in response to PA-10-012 for technologically enhanced Stage II research. Consistent with the specific research interest of the PA, this application builds on findings from an open-label Stage I study that developed and piloted a HIV prevention intervention to reduce methamphetamine use and high-risk sexual behaviors among out-of-treatment, methamphetamine-using MSM. During the pilot study, text messages - based on established behavioral change theories and specifically tailored to urban, out-of-treatment, methamphetamine-using MSM - were developed and tested. The proposed Stage II trial will assess the impact of an 8-week, gay-specific, theory-based text-messaging intervention designed to decrease methamphetamine use and HIV sexual risk behavior and, for the HIV-infected participants, simultaneously increase HIV antiretroviral treatment/adherence in out-of-treatment, methamphetamine-using MSM (N = 285). Participants will receive text messages that are personally tailored to fit their risk profile; the theory-based text messages serve as the mechanisms of behavior change. Participants will be randomized into one of three conditions: Group 1: culturally relevant theory-based text messages interactively transmitted by peer health educators (TXT-PHE); or, Group 2: the same culturally relevant theory-based text messages transmitted by automation (TXT-Auto); or, Group 3: assessment-only (AO) control with no theoretically based text messages. Participants will receive brief weekly text-message assessments on their methamphetamine use and HIV sexual behaviors in the previous seven days. The specific aims of this research are: 1) To determine differential immediate and sustained effects of transmitting theory-based text messages by PHE (TXT-PHE) versus by automation (TXT- Auto), compared to an assessment-only (AO) control condition among out-of-treatment, methamphetamine- using MSM for reductions of methamphetamine use and HIV sexual risk behaviors; and, 2) To determine the cost-effectiveness of TXT-PHE vs. TXT-Auto compared to AO for reducing methamphetamine use and HIV sexual risk behaviors. The randomized three-group design uses repeated assessments at baseline, at the end of the intervention, and at 3-, 6-, and 9-month post-randomization follow-up.